<template>
  <div class="layout" id="home">
    <div class="header">
      <mu-appbar title="泰国游戏">
        <mu-icon-button icon="close" slot="left" @click="handleQuit()"/>

        <mu-icon-button icon="refresh" slot="right" @click="handleRefrsh()"/>
      </mu-appbar>
      <mu-row gutter>
        <mu-col width="50" tablet="50" desktop="10">
          <mu-col>
            <div>
              <mu-list-item title="" disabled style="float:left">
                <mu-avatar  slot="" v-bind:src="headurl" :size="60"/>
              </mu-list-item>
            </div>
            <div>
              <mu-row gutter>
                <span  v-if="!this.isAgent" style="font-size:11px;color:white;margin-top:8px;position:relative;top:16px;">{{this.roleName}}</span>
                <span  v-if="this.isAgent && this.agentLevel == 3" style="font-size:11px;color:white;margin-top:8px;position:relative;top:16px;">总代理</span>
                <span  v-if="this.isAgent && this.agentLevel == 2" style="font-size:11px;color:white;margin-top:8px;position:relative;top:16px;">一级代理</span>
                <span  v-if="this.isAgent && this.agentLevel == 1" style="font-size:11px;color:white;margin-top:8px;position:relative;top:16px;">二级代理</span>
              </mu-row>
              <mu-row gutter>
                <span style="color:white;position:relative;top:32px;">{{this.account}}</span>
              </mu-row>
            </div>
          </mu-col>
        </mu-col>
        <mu-col width="50" tablet="50" desktop="90" style="margin-top:32px;" v-if="this.isAgent">
          <div>
            <mu-row gutter>
              <div style="width:90%;font-size:11px;text-align:left;" v-if="this.agentLevel==1">还差{{this.upLevelNdot - this.totalNdot}}金币升级一级代理</div>
              <div style="width:90%;font-size:11px;text-align:left;" v-if="this.agentLevel==2">还差{{this.upLevelNdot - this.totalNdot}}金币升级总代理</div>
              <div style="width:90%;font-size:11px;text-align:left;" v-if="this.agentLevel==3">还差{{50000000 - this.totalNdot}}金币获得特殊奖励</div>
            </mu-row>
            <mu-row gutter style="width:80%">
              <mu-slider v-if="this.agentLevel==1 || this.agentLevel==2" v-model="this.percent" style="margin:0px"/>
              <mu-slider v-if="this.agentLevel==3" v-model="this.totalNdot/500000" style="margin:0px"/>
            </mu-row>
          </div>
        </mu-col>
      </mu-row>
    </div>
    <div class="content">
      <mu-row gutter style="background-color:white" v-if="this.isAdmin">
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px" @click.native="jump('NewAdUserNumHistory')">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{newAdUser}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">今日广告新增</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px" @click.native="jump('NewUserNumHistory')">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{newUser}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">今日新增玩家</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px" @click.native="jump('NewAgentNumHistory')">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{newAgent}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">今日新增代理</span>
          </mu-row>
        </mu-col>
      </mu-row>

      <mu-row gutter style="background-color:white" v-if="this.isGm1">
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>

          </mu-row>
          <mu-row gutter>

          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px" @click.native="jump('AuditInformation')">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.newApply}}个申请</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">授权代理</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>

          </mu-row>
          <mu-row gutter>

          </mu-row>
        </mu-col>
      </mu-row>

      <mu-row gutter style="background-color:white" v-if="this.isCarrieroperator">
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px" @click.native="jump('AgentExpandHistory')">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.todayExpand}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">今日推广业绩</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.todayNdot}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">可提取业绩</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px" @click.native="jump('AuditInformation')">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.newApply}}个申请</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">授权代理</span>
          </mu-row>
        </mu-col>
      </mu-row>

      <mu-row gutter style="background-color:white" v-if="this.isAgent">
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.agentToday}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">今日推广</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.agentTotal}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">总推广</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px" @click.native="jump('AuditInformation')">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.newApply}}个申请</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">授权代理</span>
          </mu-row>
        </mu-col>
      </mu-row>

      <mu-row gutter style="background-color:white" v-if="this.isBoss">
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.agentToday}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">今日业绩</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.agentTotal}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">总业绩</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>

          </mu-row>
          <mu-row gutter>

          </mu-row>
        </mu-col>
      </mu-row>

      <mu-row gutter style="background-color:white" v-if="this.isWhite">
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>

          </mu-row>
          <mu-row gutter>

          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>
            <span style="margin: 0 auto;">{{this.leftNdot}}个</span>
          </mu-row>
          <mu-row gutter>
            <span style="margin: 0 auto;">剩余金币</span>
          </mu-row>
        </mu-col>
        <mu-col width="33" tablet="33" desktop="33" style="margin-top:8px">
          <mu-row gutter>

          </mu-row>
          <mu-row gutter>

          </mu-row>
        </mu-col>
      </mu-row>

      <div class="body">
        <!-- <mu-menu>
          <mu-menu-item title="Preview" leftIcon="remove_red_eye"/>
          <mu-menu-item title="Share" leftIcon="person_add"/>
          <mu-menu-item title="Get Links" leftIcon="link"/>
          <mu-divider />
          <mu-menu-item title="Make a copy" leftIcon="content_copy"/>
          <mu-menu-item title="Download" leftIcon="file_download"/>
          <mu-menu-item title="Remove" leftIcon="delete"/>
        </mu-menu> -->
        <mu-list v-if="this.isAdmin">
          <!-- <mu-list-item title="运营商管理" :to="{name: 'CarrieroperatorMenu' }">
            <mu-avatar v-bind:src="this.$image.camana" slot="leftAvatar"/>
            <mu-icon value="arrow_forward"  slot="right"/>
          </mu-list-item> -->
          <mu-list-item title="贡献查询" :to="{name: 'ContributeMenu' }">
            <mu-avatar v-bind:src="this.$image.contribute" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="代理详情" :to="{name: 'AgentMenu' }">
            <mu-avatar v-bind:src="this.$image.agent" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="玩家详情" :to="{name: 'UserMenu' }">
            <mu-avatar v-bind:src="this.$image.player" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="游戏详情" :to="{name: 'Chart' }">
            <mu-avatar v-bind:src="this.$image.gm" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
        </mu-list>

        <mu-list v-if="this.isCarrieroperator">
          <mu-list-item title="生成礼品码" :to="{name: 'CodeMenu' }">
            <mu-avatar v-bind:src="this.$image.gift" slot="leftAvatar"/>
            <mu-icon value="arrow_forward"  slot="right"/>
          </mu-list-item>
          <mu-list-item title="贡献查询" :to="{name: 'ContributeMenu' }">
            <mu-avatar v-bind:src="this.$image.contribute" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="代理详情" :to="{name: 'AgentMenu' }">
            <mu-avatar v-bind:src="this.$image.agent" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="玩家详情" :to="{name: 'UserMenu' }">
            <mu-avatar v-bind:src="this.$image.player" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="个人信息" :to="{name: 'AboutMe' }">
            <mu-avatar v-bind:src="this.$image.gm" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
        </mu-list>

        <mu-list v-if="this.isGm">
          <mu-list-item title="生成礼品码" :to="{name: 'CodeMenu' }">
            <mu-avatar v-bind:src="this.$image.gift" slot="leftAvatar"/>
            <mu-icon value="arrow_forward"  slot="right"/>
          </mu-list-item>
          <mu-list-item title="修改邀请码" :to="{name: 'UpdateShareCode' }">
            <mu-avatar v-bind:src="this.$image.contribute" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="代理信息" :to="{name: 'AgentInfoMenu' }">
            <mu-avatar v-bind:src="this.$image.agent" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="玩家信息" :to="{name: 'UserInfo' }">
            <mu-avatar v-bind:src="this.$image.player" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="GM管理" :to="{name: 'GmMenu' }">
            <mu-avatar v-bind:src="this.$image.gm" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
        </mu-list>

        <mu-list v-if="this.isAgent">
          <mu-list-item title="贡献查询" :to="{name: 'ContributeMenu' }">
            <mu-avatar v-bind:src="this.$image.contribute" slot="leftAvatar"/>
            <mu-icon value="arrow_forward"  slot="right"/>
          </mu-list-item>
          <mu-list-item title="代理详情" :to="{name: 'AgentMenu' }">
            <mu-avatar v-bind:src="this.$image.agent" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="玩家详情" :to="{name: 'UserMenu' }">
            <mu-avatar v-bind:src="this.$image.player" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="个人信息" :to="{name: 'AboutMe' }">
            <mu-avatar v-bind:src="this.$image.gm" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
        </mu-list>

        <mu-list v-if="this.isWhite">
          <mu-list-item title="生成礼品码" :to="{name: 'CodeMenu' }">
            <mu-avatar v-bind:src="this.$image.gift" slot="leftAvatar"/>
            <mu-icon value="arrow_forward"  slot="right"/>
          </mu-list-item>
          <mu-list-item title="赠送金币" :to="{name: 'Give' }">
            <mu-avatar v-bind:src="this.$image.agent" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
        </mu-list>

        <mu-list v-if="this.isBoss">
          <mu-list-item title="业绩查询" :to="{name: 'ScoreMenu' }">
            <mu-avatar v-bind:src="this.$image.gift" slot="leftAvatar"/>
            <mu-icon value="arrow_forward"  slot="right"/>
          </mu-list-item>
          <mu-list-item title="运营商详情" :to="{name: 'BossCaMenu' }">
            <mu-avatar v-bind:src="this.$image.agent" slot="leftAvatar"/>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
          <mu-list-item title="">
            <mu-avatar v-bind:src="this.$image.player" slot="leftAvatar"/>
            <div class="mu-item-title">玩家详情<span style="color:red">&nbsp;{{ this.totalUser }}</span></div>
            <mu-icon value="arrow_forward" slot="right"/>
          </mu-list-item>
        </mu-list>

        <mu-list v-if="this.isGm1">
          <mu-list-item title="授权管理" :to="{name: 'AuthMenu' }">
            <mu-avatar v-bind:src="this.$image.gm" slot="leftAvatar"/>
            <mu-icon value="arrow_forward"  slot="right"/>
          </mu-list-item>
          <mu-list-item title="玩家详情" :to="{name: 'UserDetail' }">
            <mu-avatar v-bind:src="this.$image.player" slot="leftAvatar"/>
            <mu-icon value="arrow_forward"  slot="right"/>
          </mu-list-item>
          <mu-list-item title="代理详情" :to="{name: 'AgentDetail' }">
            <mu-avatar v-bind:src="this.$image.agent" slot="leftAvatar"/>
            <mu-icon value="arrow_forward"  slot="right"/>
          </mu-list-item>
        </mu-list>

      </div>
    </div>
    <div class="footer">

    </div>
    <!-- <mu-infinite-scroll :scroller="scroller" :loading="loading" @load="loadMore"/> -->

    <mu-dialog :open="dialog" title="提示" @close="close">
      确认退出？
      <mu-flat-button slot="actions" @click="close" primary label="取消"/>
      <mu-flat-button slot="actions" primary @click="handleLogout()" label="确定"/>
    </mu-dialog>
  </div>
</template>
<script>
export default {
  data () {
    return {
      headurl: this.$image.img,
      loading: false,
      scroller: null,

      account: '',
      role: '',
      roleName: '',

      isAdmin: false,
      isCarrieroperator: false,
      isAgent: false,
      isWhite: false,
      isGm: false,
      isGm1: false,
      isBoss: false,

      newUser: 0,
      newAdUser: 0,
      newAgent: 0,
      newApply: 0,

      todayExpand: 0,
      todayNdot: 0,
      leftNdot: 0,

      agentToday: 0,
      agentTotal: 0,

      agentLevel: 0,
      totalNdot: 0,

      totalUser: 0,

      upLevelNdot: 0,

      startDay: this.$time.getDateBefore(new Date(), 0),
      endDay: this.$time.getDateBefore(new Date(), 0),

      dialog: false
    }
  },
  methods: {
    init () {
      if (sessionStorage.getItem('account')) {
        this.account = sessionStorage.getItem('account')
      } else {
        this.$router.push({name: 'Login'})
      }

      if (sessionStorage.getItem('role')) {
        this.role = sessionStorage.getItem('role')
      } else {
        this.$router.push({name: 'Login'})
      }

      if (this.role === 'admin') {
        this.isAdmin = true
        this.roleName = '官方'
        sessionStorage.setItem('isAdmin', true)
      }

      if (this.role === 'carrieroperator') {
        this.isCarrieroperator = true
        this.roleName = '运营商'
        sessionStorage.setItem('isCarrieroperator', true)
      }

      if (this.role === 'agent') {
        this.isAgent = true
        this.roleName = '代理'
        sessionStorage.setItem('isAgent', true)
      }

      if (this.role === 'white') {
        this.isWhite = true
        this.roleName = '白户'
        sessionStorage.setItem('isWhite', true)
      }

      if (this.role === 'gm') {
        this.isGm = true
        this.roleName = 'GM'
        sessionStorage.setItem('isGm', true)
      }

      if (this.role === 'gm1') {
        this.isGm1 = true
        this.roleName = 'GM1'
        sessionStorage.setItem('isGm1', true)
      }

      if (this.role === 'boss') {
        this.isBoss = true
        this.roleName = '总后台'
        sessionStorage.setItem('isBoss', true)
      }

      // 官方
      if (this.isAdmin) {
        this.getNewUserNumber()
        this.getNewAgentNumber()
        this.getNewAgentApplyNumber()
        this.getNewAdUserNumber()
      }

      // 运营商
      if (this.isCarrieroperator) {
        this.getTodayExpand()
        this.getNewAgentApplyNumber()
      }

      // 白户
      if (this.isWhite) {
        this.getLeftNdot()
      }

      // 代理
      if (this.isAgent) {
        this.getAgentExpand()
        this.getAgentLevel()
        this.getUpLevelNdot()
        this.getHeadUrl()
        this.getNewAgentApplyNumber()
      }

      // 总后台
      if (this.isBoss) {
        this.getBossExpand()
        this.getBossTotalNumber()
      }

      // GM1
      if (this.isGm1) {
        this.getNewAgentApplyNumber()
      }
    },
    getNewAdUserNumber () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/GmService.getAdNewUserNum',
        params: {'startDay': this.startDay, 'endDay': this.endDay}
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.newAdUser = resp.data.data
        }
      })
    },
    getNewUserNumber () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AgentService.getNewUserNum',
        params: {'account': sessionStorage.getItem('account'), 'startDay': this.startDay, 'endDay': this.endDay}
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.newUser = resp.data.data
        }
      })
    },
    getNewAgentNumber () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AgentService.getNewAgentNumber',
        params: {'account': sessionStorage.getItem('account'), 'startDay': this.startDay, 'endDay': this.endDay}
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.newAgent = resp.data.data
        }
      })
    },
    getNewAgentApplyNumber () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AgentService.getNewAgentApplyNumber',
        params: {'account': sessionStorage.getItem('account'), 'startDay': this.startDay, 'endDay': this.endDay}
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.newApply = resp.data.data
        }
      })
    },
    getTodayExpand () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AgentService.todayExpand',
        params: {'account': sessionStorage.getItem('account'), 'startDay': this.startDay, 'endDay': this.endDay}
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.todayExpand = resp.data.todayExpand
          that.todayNdot = resp.data.todayNdot
        }
      })
    },
    getLeftNdot () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AgentService.getAvailableNdot',
        params: {'account': sessionStorage.getItem('account')}
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.leftNdot = resp.data.data
        } else {
          that.$message({
            showClose: true,
            message: resp.data.cause,
            type: 'warning'
          })
        }
      })
    },
    getAgentExpand () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AgentService.getAgentExpand',
        params: {'account': sessionStorage.getItem('account')}
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.agentToday = resp.data.data.todayNdot
          that.agentTotal = resp.data.data.totalNdot
        } else {
          that.$message({
            showClose: true,
            message: resp.data.cause,
            type: 'warning'
          })
        }
      })
    },
    getHeadUrl () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AuthService.getHeadUrl'
      })
      .then((resp) => {
        if (resp.data.status === 'success') {
          if (resp.data.data !== null && resp.data.data !== '' && resp.data.data !== undefined) {
            that.headurl = resp.data.data
          }
        }
      })
    },
    getAgentLevel () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/CarrieroperatorService.getAgent',
        params: {'account': sessionStorage.getItem('account')}
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.agentLevel = resp.data.data.agentLevel
          that.totalNdot = resp.data.data.totalNdot
        }
      })
    },
    getUpLevelNdot () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/CarrieroperatorService.getUpLevelNdot',
        params: {'account': sessionStorage.getItem('account')}
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.upLevelNdot = resp.data.upLevelNdot
        }
      })
    },
    handleRefrsh () {
      this.init()
      this.$message({
        message: '已刷新',
        type: 'success',
        duration: 1000
      })
    },
    handleQuit () {
      this.dialog = true
    },
    close () {
      this.dialog = false
    },
    handleLogout () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AuthService.quit'
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          sessionStorage.clear()
          that.$router.push({name: 'Login'})
        } else {
          that.$message({
            message: resp.data.cause,
            type: 'warning'
          })
        }
      })
    },
    getBossExpand () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AgentService.getBossExpand'
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.agentToday = resp.data.todayNdot
          that.agentTotal = resp.data.totalNdot
        }
      })
    },
    jump (Name) {
      if (Name === 'AuditInformation') {
        if (this.agentLevel === 1) {
          this.$message.success('您还没有升级为一级代理，无法授权代理')
          return false
        }
      }
      this.$router.push({name: Name})
    },
    getBossTotalNumber () {
      let that = this
      this.$axios({
        method: 'get',
        url: '/api/AgentService.getBossTotalNumber'
      })
      .then(function (resp) {
        if (resp.data.status === 'success') {
          that.totalUser = resp.data.totalUser
        }
      })
    }
  },
  mounted () {
    this.init()
  },
  computed: {
    percent: function () {
      return this.totalNdot/this.upLevelNdot*100
    }
  }
}
</script>

<style>
#home .layout{
  background-color: rgb(236, 236, 236);
}

#home .header{
  background-image: url('../../static/images/bg.jpg');
  filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale')";
  -moz-background-size:100% 100%;
      background-size:100% 100%;
  background-attachment: fixed;
}

#home .nav{
  display: inline-block;
  width: calc(100% - 150px);
  margin: 0 auto;
}

#home .tab{
  margin: 0 auto;
  width: 400px;
  background-color: rgba(0, 0, 0, 0);
}

#home .content{
  width: 100%;
  margin: 0 auto;
}

#home .body{
  background-color: white;
  border-radius: 5px;
  min-height: 500px;
}

#home .footer{
  padding: 20px 0;
  text-align: center;
}

#home .menu {
  color: black;
}

#home .demo-slider {
  margin-bottom: 16px;
}

.mu-item-title {
  text-align: left;
}
</style>
